Field of the Invention
The present invention relates to an image processing apparatus that forms a distance image indicating the distance to a subject from a plurality of images, and a control method thereof, as well as a storage medium.
Description of the Related Art
In the field of computer vision or the like, there is a demand for obtaining accurate distance information of a subject from a shot image.
For example, Japanese Laid-Open Patent Publication (Kokai) No. 2012-3233 discloses a technique of changing, according to the image height, a value of a Gaussian filter in a convolution operation performed to calculate distance information, in order to accurately estimate the distance by reducing the estimated distance error caused by a change in a blur function associated with a change in the image height.
Japanese Laid-Open Patent Publication (Kokai) No. 2013-30895 discloses a technique of reducing an error of distance information associated with a deviation of blur caused by image surface curvature, wherein defocus information as already-known information is used to correct the error.
However, in the related art above, the Gaussian filter or the defocus information used for the correction needs to be held in advance in a recording medium, such as a ROM, to correct the distance information.
In the related art above, a correlation degree of a plurality of images with different focusing positions is computed to form an image in which distance information is calculated for each pixel of an input image (hereinafter referred to as “the distance image”). However, correction of an error during the computation of the degree of correlation is not mentioned.